﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yitter.IdGenerator;

namespace RBAC_Model
{
    public class BaseEntity
    {
        /// <summary>
        /// 实体的唯一标识符
        /// </summary>
        [SugarColumn(IsPrimaryKey = true)]
        [DatabaseGenerated(DatabaseGeneratedOption.None)]
        public long Id { get; set; } = YitIdHelper.NextId();

        /// <summary>
        /// 实体的创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }= DateTime.Now;

        /// <summary>
        /// 实体的最后更新时间
        /// </summary>
        public DateTime UpdateTime { get; set; }= DateTime.Now;
        /// <summary>
        /// 实体是否被删除
        /// </summary>
        public bool IsDeleted { get; set; } = false;
    }
}
